Ext.define('AgenteNET.Index.Store.Model.<?php echo $this->modelName;?>.Data',{
    extend:'Ext.data.Store',
    storeId:'<?php echo $this->modelName;?>Store',
    autoLoad:true,
    autoSync:true,
    fields:<?php echo Application_Model_Extjs::getStoreFields($this->model);?>,
    
    proxy: {
        api:{
            create  : '/agentenet/public/Index/Data/Model/<?php echo $this->modelName;?>/method/post',
            read    : '/agentenet/public/Index/Data/Model/<?php echo $this->modelName;?>/method/get/id/',
            update  : '/agentenet/public/Index/Data/Model/<?php echo $this->modelName;?>/method/put/id/',
            destroy : '/agentenet/public/Index/Data/Model/<?php echo $this->modelName;?>/method/delete/id/'
        },
        type:'rest',
        reader:{
            type:'json',
            root:'data'
        }
    },
    views:{
      <?php foreach($this->model->getViews() as $view=>$setup): ?>
       <?php echo $view;?>:function(config,model){
          var setup=<?php echo Application_Model_Extjs::getView($this->model,$view);?>;
          for(i in config)setup[i]=config[i];
          console.log(setup);
          return Ext.create('<?php echo isset($setup['xtype'])?$setup['xtype']:'Ext.panel.Panel';?>',setup);
       }
     <?php endforeach; ?>  
    }
});

//Ext.create('AgenteNET.Index.Store.Model.<?php echo $this->modelName;?>.Data');
